package com.fhzn.boss.web.request;

import com.fhzn.boss.context.RequestContext;
import com.google.common.base.MoreObjects;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * @author 老顾
 * @apiNote
 * @since 2023/12/28
 */
@Data
public class UserModifyRequest {

    /**
     * uid
     * 对应nickname
     */
    private String nickname;

    /**
     * nicknameCn
     */
    private String nicknameCn;

    /**
     * 真名
     */
    private String realName;


    /**
     * 状态 1：启用 0：禁用
     */
    private Integer status;

    /**
     * 用户类型
     */
    private Integer userType;

    private Integer id;

    /**
     * 操作人
     **/
    @NotNull(message = "操作人不能为空")
    private String handler;

    /**
     * appCode
     **/
    private String appCode;


    public String getAppCode() {
        return MoreObjects.firstNonNull(appCode, RequestContext.getRequestData().getInvokeAppName());
    }

    public String getHandler() {
        return MoreObjects.firstNonNull(handler, RequestContext.getRequestData().getHandler());
    }

}
